<?php
  class fb
  {
	public $key = '?access_token=AAACEdEose0cBANZAFxfQmGNBpnM0auTAbmrRljEui6WxDctwZBy68CMmVVMKlDWOgcuxm5x1nIsiz0cUq9gzDAu8yFjRdepVcFIXr0jo8E9yNO80ln';
	private $link = 'https://graph.facebook.com/';
	
	/**
	* Curl Get Url
	* 
	* @param mixed $url
	*/
	public function get($url)
	{
		$curl = curl_init($url);
		curl_setopt($curl, CURLOPT_HEADER, 1);
		$sonuc = curl_exec($curl);
		curl_close($curl);
		return $sonuc;	
	}
	
	/**
	* get Facebook Like Pages
	* 
	* @param mixed $pageID
	*/
	public function getPages($pageID = false)
	{
		$pagesJson =  $this->get($this->link.'100004676468753?fields=likes'.$this->key);
		$pagesArray = json_encode($pagesJson);
		echo $pagesJson.'<br><pre>';
		var_dump($pagesArray);
		die;
		
	}
	
  }
?>
